﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UserManagementWCFService
{
    class UserManager
    {
        private static UserManager instance = new UserManager();

        public static UserManager INSTANCE
        {
            get { return instance; }
        }

        UserDataManager userDataManager = UserDataManager.INSTANCE;

        private UserManager()
        {
            //Only instantiated once. We read the relevant information from the user
            //xml file. We also get a handle to the user data manager.
        }

        public void addUser(User user)
        {
            userDataManager.addUser(user);
        }

        public User getUser(String username)
        {
            return userDataManager.getUser(username);
        }

        public User getUser(Guid userId)
        {
            return userDataManager.getUser(userId);
        }

        public bool availableUserName(String username)
        {
            return !userDataManager.containsUser(username);
        }

    }
}
